<form id="o2o_confirm_form" method='post' action='index.php?app=o2o&ctl=admin_inventory&act=doConfirm'>
<input type='hidden' name='inventory_id' value="<{$inventory_id}>" /> 
<input type='hidden' name='branch_id' value="<{$branch_id}>" /> 
<div class="tableform">
<div class="division" >
<h4>基本信息</h4>
    <table width='100%' cellspacing="0" cellpadding="0" >
      <tr>
          <td>盘点单编号：<{$inv_info.inventory_bn}></td>
          <td>盘点类型：<{$inv_info.inventory_type_text}></td>
      </tr>
      <tr>
          <td>申请人：<{$inv_info.op_name}></td>
          <td>盘点人：<{$inv_info.confirm_op_name}></td>
      </tr>
      <tr>
          <td>门店：<{$inv_info.store_name}></td>
          <td>申请时间: <{$inv_info.createtime_format}></td>
      </tr>
      <tr>
            <td>盘点时间：<{$inv_info.confirm_time_format}></td>
      </tr>
    </table>
    
<h4>盘点明细</h4>
    <table width='100%' cellspacing="0" cellpadding="0" class="gridlist delivery-cfg-table">
        <thead>
        <tr>
            <th>物料名称</th>
            <th>物料编码</th>
            <th>规格</th>
            <th>线上帐面数量</th> 
            <th>共享帐面数量</th>
            <th>线上实际数量</th>
            <th>共享实际数量</th>
            <th>线上盈(+)亏(-)</th>
            <th>共享盈(+)亏(-)</th>
          </tr>
        </thead>
        <{foreach from=$items item=items key=keys}>
        <tbody id="detail_data">
        <tr class="toggler<{if $items.shortage_over==0}>show<{/if}>" id="show" <{if $items.is_auto==1}>bgcolor='#cccccc'<{/if}>>
            <td><{$items.material_name}></td>
            <td><{$items.material_bn}></td>
            <td><{$items.spec_info}></td>
            <td><{$items.accounts_num}></td>
            <td><{$items.accounts_share_num}></td>                
            <td><{$items.actual_num}></td>
            <td><{$items.actual_share_num}></td>
            <td><{$items.short_over}></td>
            <td><{$items.share_short_over}></td>
          </tr>
        </tbody>
        <{/foreach}>
    </table>
</div>

<div class="gridlist-footer">
<{$pager}>&nbsp;&nbsp;共<{$count}>条，每页显示<{$pagelimit}>条 
</div>
    
<div class="table-action">
    <{button type="button" class="btn" id="confirm-btn" label="确 认"}>
    <{button type="button" class="btn" id="return-btn" label="关 闭" onclick="javascript:this.getParent('.dialog').retrieve('instance').close();"}>
</div>

</div>
</form>

<script>
(function(){
    var confirm_btn = $('confirm-btn');
    var finder = finderGroup['<{$env.get.finder_id}>'];
    //确认
    $('confirm-btn').addEvent('click',function(e){
        var _form = $("o2o_confirm_form");
        var url = _form.action;
        new Request({url:url,method:'post',data:_form,
            onComplete:function(result){
                if(!result) return;
                ret = JSON.decode(result);
                if(ret.error){
                    MessageBox.error(ret.error);
                    return false;
                }
                alert("确认成功 已加入队列 系统会自动跑完队列");
                confirm_btn.getParent('.dialog').retrieve('instance').close();
                finder.refresh();
            },
        }).send();
        
        
    });
})();

</script>

